x86/fpu: create lazy and non-lazy FPU restore functions
authorWei Huang <wei.huang2@amd.com>
Mon, 9 May 2011 10:39:23 +0000 (11:39 +0100)
committerWei Huang <wei.huang2@amd.com>
Mon, 9 May 2011 10:39:23 +0000 (11:39 +0100)
commit5968755d6dab2b3e193bdaf1d23658d3f1328a25
treef4fb78f9015766fc70f665080abfa20daa9a91db
parent0217c28adbb1656e72ce68239eb6092fdc7cde0c
x86/fpu: create lazy and non-lazy FPU restore functions

Currently Xen relies on #NM (via CR0.TS) to trigger FPU context
restore. But not all FPU state is tracked by TS bit. This function
creates two FPU restore functions: vcpu_restore_fpu_lazy() and
vcpu_restore_fpu_eager(). vcpu_restore_fpu_lazy() is still used when
#NM is triggered. vcpu_restore_fpu_eager(), as a comparision, is
called for vcpu which is being scheduled in on every context
switch. To minimize restore overhead, it creates a flag,
nonlazy_xstate_used, to control non-lazy restore.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/i387.c
xen/arch/x86/traps.c
xen/include/asm-x86/domain.h
xen/include/asm-x86/i387.h